package com.easy.api.bean.file;

import com.easy.api.factory.file.service.GenerateExcelService;

public enum FileType {

    FOLDER("folder", "文件夹",null,null),
    MP4("mp4", "视频",null,null),
    JPG("jpg", "图片",null,null),
    JPEG("jpeg", "图片",null,null),
    GIF("gif", "动图",null,null),
    PNG("png", "图片",null,null),
    HTML("html", "html页面",null,null),
    PDF("pdf", "文档",null,null),
    DOC("doc", "文档",null,null),
    DOCX("docx", "文档",null,null),
    PPT("ppt", "ppt",null,null),
    PPTX("PPTX", "PPTX",null,null),
    ZIP("zip", "压缩文件",null,null),
    SQL("sql", "sql语句",null,null),
    TXT("txt", "文本",null,null),
    FLV("flv", "视频",null,null),
    AVI("avi", "视频",null,null),
    XLS("xls", "excel文件","generateExcelService", GenerateExcelService.class),
    XLSX("xlsx", "excel文件",null,null);

    private String code;
    private String desc;
    private String serviceName;
    private Class<?> aClass;

    FileType(String code, String desc, String serviceName, Class<?> aClass) {
        this.code = code;
        this.desc = desc;
        this.serviceName = serviceName;
        this.aClass = aClass;
    }



    public static FileType toEnum(String code) {
        for (FileType category : FileType.values()) {
            if (category.getCode().equals(code)) {
                return category;
            }
        }
        return null;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public Class<?> getaClass() {
        return aClass;
    }

    public void setaClass(Class<?> aClass) {
        this.aClass = aClass;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

}
